package com.luyu.controller;

import com.luyu.entity.User;
import com.luyu.res.ResultRes;
import com.luyu.service.UserService;
import com.luyu.tenant.TenantContextHolder;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping({"/auth/{tenantId}"})
public class TenantController {

    @Resource
    private UserService userService;


    @GetMapping
    public Long sendConfirm(@PathVariable("tenantId") Long tenantId) {
        return TenantContextHolder.getTenantId();
    }


    @GetMapping("/page")
    public ResultRes<User> page(@PathVariable("tenantId") Long tenantId) {
        return ResultRes.success(userService.page());
    }


}
